home *** CD-ROM | disk | FTP | other *** search
-
- #
- # test the String <-> XmString converters
- #
-
- if {[string compare test [info procs test]] == 1} then \
- {source defs}
-
- # set VERBOSE 1
- # set INTERACTIVE 1
-
-
- #############
- # starts here
- #############
-
- xtAppInitialize -class List
- . setValues -allowShellResize true
-
- xmRowColumn .stringrc managed
- xmLabel .stringrc.label -managed
- xmList .stringrc.list managed
-
- test string-1.1 {empty string} {
- .stringrc.label setValues -labelString ""
- .stringrc.label getValues -labelString x
- set x
- } {}
-
-
- test string-1.2 {simple string} {
- .stringrc.label setValues -labelString "simple label"
- .stringrc.label getValues -labelString x
- set x
- } {simple label}
-
- test string-1.3 {string with spaces} {
- .stringrc.label setValues -labelString "simple label with extra spaces"
- .stringrc.label getValues -labelString x
- set x
- } {simple label with extra spaces}
-
- test string-1.4 {string with newlines} {
- .stringrc.label setValues -labelString "simple label
- with
-
- newlines"
- .stringrc.label getValues -labelString x
- set x
- } {simple label with newlines}
-
- test string-1.5 {string with end spaces} {
- .stringrc.label setValues -labelString " simple label with leading/trailing spaces "
- .stringrc.label getValues -labelString x
- set x
- } {simple label with leading/trailing spaces}
-
- test string-2.1 {embedded spaces} {
- .stringrc.label setValues -labelString {{spaced string}}
- .stringrc.label getValues -labelString x
- set x
- } {spaced string}
-
-
- test string-2.2 {leading spaces} {
- .stringrc.label setValues -labelString {{ leading spaced string}}
- .stringrc.label getValues -labelString x
- set x
- } { leading spaced string}
-
- test string-2.3 {trailing spaces} {
- .stringrc.label setValues -labelString {{trailing spaced string }}
- .stringrc.label getValues -labelString x
- set x
- } {trailing spaced string }
-
- test string-3.1 {newlines in string} {
- .stringrc.label setValues -labelString {{newlined
- string}}
- .stringrc.label getValues -labelString x
- set x
- } {newlined
- string}
-
- test string-3.2 {trailing newlines} {
- .stringrc.label setValues -labelString {"trailing
- newlined
- string
-
-
- "}
- .stringrc.label getValues -labelString x
- set x
- } {trailing
- newlined
- string
-
-
- }
-
- test string-3.3 {leading newlines} {
- .stringrc.label setValues -labelString {"
-
-
- leading
- newlined
- string"}
- .stringrc.label getValues -labelString x
- set x
- } {
-
-
- leading
- newlined
- string}
-
- test string-4.1 {embedded newlines} {
- .stringrc.label setValues -labelString {newline @n in @n string}
- .stringrc.label getValues -labelString x
- set x
- } {newline
- in
- string}
-
- test string-4.2 {trailing newlines} {
- .stringrc.label setValues -labelString {newline after string @n @n}
- .stringrc.label getValues -labelString x
- set x
- } {newline after string
-
- }
-
- test string-4.3 {leading newlines} {
- .stringrc.label setValues -labelString {@n @n newline before string}
- .stringrc.label getValues -labelString x
- set x
- } {
-
- newline before string}
-
-
- test string-5.1 {list test} {
- .stringrc.list setValues \
- -itemCount 2 \
- -items {{{ a b }} {abcd}}
- .stringrc.list getValues \
- -items ll
- set ll
- } {{ a b } abcd}
-
-
- #############
- # Finish up #
- #############
- if { ! $INTERACTIVE} {
- .stringrc.label destroyWidget
- .stringrc.list destroyWidget
- .stringrc destroyWidget
- } else {
- . mainLoop
- }
-